package com.ruoyi.activity.api.controller;

import cn.dev33.satoken.stp.StpUtil;
import java.util.UUID;
import com.ruoyi.activity.domain.TbUser;
import com.ruoyi.activity.domain.TbUserCoupon;
import com.ruoyi.activity.service.ITbUserCouponService;
import com.ruoyi.activity.service.ITbUserService;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.common.core.domain.model.H5LoginBody;
import com.ruoyi.common.core.domain.model.LoginBody;
import com.ruoyi.common.utils.SecurityUtils;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang3.ObjectUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.validation.Valid;

/**
 * @author jll
 * @createTime 2025/6/14
 * @description 用户注册控制层
 * @version: 1.0
 */
@RestController
@RequestMapping("/api/auth")
@Api("APP授权认证API")
public class AuthController {

    @Autowired
    private ITbUserService  tbUserService;

    @PostMapping("/login")
    @ApiOperation("账号密码登录")
    public AjaxResult login(@RequestBody @Valid H5LoginBody h5LoginBody) {
        return tbUserService.login(h5LoginBody);
    }
}
